package com.hsgene.generator.util.generator;

import com.hsgene.common.util.basic.UUID32;

/**
 * 支付流水号生成器
 *
 * @author wangbing
 * @version 1.0, 2018/6/29
 */
public class PayGenerator extends AbstractGenerator {

    private volatile static PayGenerator instance;

    private PayGenerator() {
    }

    /**
     * 单例获取支付流水号生成器
     *
     * @return 支付流水号生成器
     */
    public static PayGenerator getInstance() {
        if (instance == null) {
            synchronized (UserGenerator.class) {
                if (instance == null) {
                    instance = new PayGenerator();
                }
            }
        }

        return instance;
    }

    @Override
    public String generate(String prefix) {
        return UUID32.randomUUIDString();
    }
}
